// .txt

beginzonescript;

variables;

short crime_tolerance = 200;
short last_abil;
short i;

body;

beginstate INIT_STATE;

	set_name(23,"Sage Olipha");
	set_level(23,28);
	set_boss_level(23,2);
	
//	add_range_to_group(first,last,whichg);

	//if (get_sdf() > 0) {
		//make_zone_hostile();
		//}

	last_abil = get_current_tick();
	
	set_crime_tolerance(crime_tolerance);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	// clear zone?
	if ((zone_clear(ME) == FALSE) && (get_flag(46,1) > 11)) {
		print_str_color("You have killed a lot of kyshakks. This area will be safe",2);
		print_str_color("  to pass now.",2);
		clear_zone(ME);	
		}
		
	//if ((get_crime_level() >= crime_tolerance) && (get_sdf(,) == 0)) {
	//	make_zone_hostile();
	//	set_flag(,,1);
	//	}

	 if (gf(46,6) > 0) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23,"Best to keep quiet.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23,"I keep to myself.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23,"Watch out for pylons.");
		}
	
	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	}
break;

beginstate 10;
	set_terrain_string_range("The sign says - KEEP OUT.",3);
break;

//	print_str("");
//	set_terrain_string_range(".",3);
//	set_terrain_string_range("The sign says - .",3);
